﻿function checkpoint(map_sel) {

	//	alert(map_sel); - id метро

	metro[map_sel][1] = 0 + !metro[map_sel][1];

	// alert(metro[map_sel][0]);

	// toggle

	var right_len = right_list.options.length;

	if(metro[map_sel][1] == 1) {
		var left_idx = -1;
		for( i = 0; i < left_list.options.length; i++)
		if(left_list.options[i].value == map_sel) {
			left_idx = i;
			break;
		}
		if(left_idx != -1) {
			right_list.options[right_len] = new Option(left_list.options[left_idx].text, left_list.options[left_idx].value);
			if(mimg[map_sel])
				a.metromap.appendChild(mimg[map_sel]);
		}

	} else {
		if(mimg[map_sel])
			a.metromap.removeChild(mimg[map_sel]);
		var right_idx = -1;
		for( i = 0; i < right_len; i++)
		if(right_list.options[i].value == map_sel) {
			right_idx = i;
			break;
		}
		if(right_idx != -1)
			right_list.remove(right_idx);
	}
}